<template>
  <div class="page cancelVerifi-details">
    <div class="scroll-view">
      <customHeader middleTitle="核销详情" />
      <div class="page-body">
        <ul class="details-box">
          <li>
            <span>已核销券码</span>
            <div>
              <ul class="txt-blue">
                <li v-for="(item,index) in data.voucherItemIds" :key="index">{{item}}</li>
              </ul>
            </div>
          </li>
          <li>
            <span>核销时间</span>
            <div>{{formateDateTime(data.createTime)}}</div>
          </li>
          <li>
            <span>核销人</span>
            <div>{{data.verifyOperatorName}}</div>
          </li>
          <li>
            <span>核销门店</span>
            <div>{{data.shopName}}</div>
          </li>
          <li>
            <span>商品名称</span>
            <div>{{data.goodsSalesName}}</div>
          </li>
          <li>
            <span>售价</span>
            <div>{{data.goodsPrice}}</div>
          </li>
          <li>
            <span>核销份数</span>
            <div>{{data.goodsCount}}</div>
          </li>
          <!-- <li>
            <span>商品有效期</span>
            <div>{{formateDate(data.effectiveStartTime)}} 至 {{formateDate(data.effectiveEndTime)}}</div>
          </li> -->
        </ul>
        <ul class="details-box">
          <div class="title">订单状态</div>
          <li>
            <span>订单编号</span>
            <div>{{data.voucherOrderId}}</div>
          </li>
          <li>
            <span>创建时间</span>
            <div>{{formateDateTime(data.createTime)}}</div>
          </li>
          <li>
            <span>付款时间</span>
             <div>{{formateDateTime(data.tradeTime)}}</div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue';
import customHeader from '../../components/header/header';
import { Toast } from 'mint-ui';
import moment from "moment";
export default {
  name: 'cancelVerifi-details',
  data() {
    return {
      data: {}
    };
  },
  methods: {
    formateDate(date) {
      if (date) {
        return moment(date).format("YYYY-MM-DD");
      } else {
        return date;
      }
    },
    formateDateTime(date) {
      if (date) {
        return moment(date).format("YYYY-MM-DD HH:mm:ss");
      } else {
        return date;
      }
    },
    getData() {
      const url = "/newapp/mall/board/queryGoodsVerificationDetail.do";
      const params = { verifyId: this.$route.query['verifyId'] };
      this.ajax({
        url: url,
        type: "post",
        data: params,
        controlLoading: true
      })
        .then(res => {
          if (res.success) {
            this.data = res.resultObject;

          } else {
            Toast(res.msg);
          }
        })
        .catch((err) => {

        });
    },

  },
  components: {
    customHeader,
  },
  created() {
    this.getData();
  },
};
</script>
<style lang='scss' scoped>
@import "cancelVerifi";
</style>
